package com.hung.dubbo;

import com.hung.dubbo.order.api.IOrderService;
import com.hung.dubbo.order.api.OrderRequest;
import com.hung.dubbo.order.api.OrderResponse;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws IOException {
        ClassPathXmlApplicationContext applicationContext =new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/order-consume.xml"});
        applicationContext.start();

        IOrderService orderService = (IOrderService) applicationContext.getBean("orderService");
        OrderRequest request = new OrderRequest();
        request.setName("zhangsan");
        OrderResponse response =orderService.saveOrder(request);
        System.out.println("response = " + response);

        System.in.read();
    }
}
